﻿module Component

open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Graphics


type Component =
    {           
//        update      : ref<Component> -> GameTime -> Unit;
        update      : GameTime -> Unit;
        draw        : GameTime -> Unit
    }


type Time = { T : float32; DT : float32 }
let current_time = ref { T = 0.0f; DT = 0.0f }


type RenderState = { mutable Text : (string * Vector2 * Vector2 * Color) option;
                     mutable TopText : (string * Vector2 * Vector2 * Color) option;
                     mutable Texture1 : (string * Vector2 * Vector2 * Color) option;
                     mutable Texture2 : (string * Vector2 * Vector2 * Color) option}

type Items =
  { sprite_batch : SpriteBatch;
    sprite_font : SpriteFont;
    renderer : RenderState;
    screen_size : Vector2 ;
    text_bar : Texture2D }